/*
var adminLimit = function() {

};
adminLimit.prototype = {};

adminLimit.prototype.init = function(game, rule) {
    Lottery.switchGame(game);
    var f = function(list) {
        // 更新单期限额信息
        if (list.targets) {
            $(".game-max").val(list.targets.max/100);
        }

        var map = rule.map;
        for (var k in list) {
            if (k == "targets") continue;
            if (isEmpty(map[k])) {
                console.log("不存在的类型", k);
                continue;
            }
            if (list[k].value)
                map[k].rate = list[k].value;
            if (list[k].back)
                map[k].back = list[k].back;
            if (list[k].min)
                map[k].min = list[k].min;
            if (list[k].max)
                map[k].max = list[k].max;
        }

        // 更新限额信息
        var arr = $(".rate input.min");
        var arr2 = $(".lottery-item label");
        var arr3 = $(".rate input.max");
        for (var i = 0; i < arr.length; i++) {
            var k = $(arr2[i]).html();
            if (!map[k]) {
                continue;
            }

            $(arr[i]).val((map[k].min || 0) / 100);
            $(arr3[i]).val((map[k].max || 0) / 100);
        }
    };
    Lottery.refresh_rate(f);
    f([]);

    $(".save").click(function() {
        var data = {};
        var arr = $(".rate input.min");
        var arr2 = $(".lottery-item label");
        var arr3 = $(".rate input.max");
        for (var i = 0; i < arr.length; i++) {
            var k = $(arr2[i]).html();
            var min = $(arr[i]).val().trim();
            if (min == '') min = 0;
            else min = parseInt(min);

            var max = $(arr3[i]).val().trim();
            if (max == '') max = 0;
            else max = parseInt(max);
            data[k] = (min * 100) + "," + (max * 100);
        }
        startLoading();
        console.log('新的限额', data);
        CMD.lottery_rate_ranges(game, data, function() {
            stopLoading();
            alert2("保存限额成功。");
        });
    });
};

adminLimit.prototype.add = function(key, title, container) {
    var t = '<div class="lottery-item">' +
            '    <div class="rate am-input-group">' +
            '        <span class="am-input-group-label">__title__</span>' +
            '        <input type="text" class="am-form-field min" placeholder="最小"/>' +
            '        <input type="text" class="am-form-field max" placeholder="最大"/>' +
            '    </div>' +
            '    <div class="clear" style="display: none"><label>__key__</label></div>' +
            '</div>';
    t = t.replace(/__title__/g, title);
    t = t.replace(/__key__/g, key);

    var td = $("<td></td>");
    td.append(t);
    container.append(td);
}

window.AdminLimit = new adminLimit();
*/